package com.yunban.project.api.text_check.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunban.project.api.text_check.domain.CorrectionFeedback;
import com.yunban.project.api.text_check.dto.PostFeedbackReq;
import com.yunban.project.api.text_check.mapper.CorrectionFeedbackMapper;
import com.yunban.project.api.text_check.service.CorrectionFeedbackService;
import net.lab1024.sa.base.common.util.SmartRequestUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * @author: lijiajun
 * @date: 2025-02-18
 * @version: 1.0
 */
@Service
public class CorrectionFeedbackServiceImpl extends ServiceImpl<CorrectionFeedbackMapper, CorrectionFeedback> implements CorrectionFeedbackService {
    @Override
    public Boolean postFeedback(PostFeedbackReq req) {
        CorrectionFeedback correctionFeedback = new CorrectionFeedback();
        correctionFeedback.setUserId(SmartRequestUtil.getUserId());
        BeanUtils.copyProperties(req, correctionFeedback);
        return this.save(correctionFeedback);
    }
}
